/**
 * Copyright 2007-2008. Chongqing First Information & Network Co., Ltd. All
 * rights reserved. <a>http://www.cqfirst.com.cn</a>
 */
package com.cqcis.uip.base.framework;

/**
 * 接口平台异常
 * 
 * @author huangmy
 * @date   2007-12-24
 */
public class UIPServiceException extends RuntimeException {
	private static final long serialVersionUID = 4389441672449144548L;
	private int errCode;
	private String message;
	
	public UIPServiceException() {
	}
	
	public UIPServiceException(int errCode) {
		this.errCode = errCode;
	}
	
	public UIPServiceException(int errCode, String message) {
		super(message);
		this.errCode = errCode;		
	}
	
	public UIPServiceException(int errCode, String message, Throwable cause) {
		super(message, cause);
		this.errCode = errCode;		
	}

	public UIPServiceException(String message) {
		super(message);
	}

	public UIPServiceException(Throwable cause) {
		super(cause);
	}

	public UIPServiceException(String message, Throwable cause) {
		super(message, cause);
	}

	public int getErrCode() {
		return errCode;
	}

	public void setErrCode(int errCode) {
		this.errCode = errCode;
	}
	
	@Override
	public String getMessage() {
		String msg = super.getMessage();
		msg = msg != null ? msg : "";
		msg = this.message != null ? this.message :  "" + msg;
		return msg;
	}

	public void setMessage(String message) {
		this.message = message;
	}
}
